package com.atguigu.gulimall.product.controller;

import com.atguigu.gulimall.product.service.TestLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author yinhao
 * @Date 2021/1/8 12:06
 * @Description
 */

@RestController
@RequestMapping("test")
public class TestLogController {

    private static final Logger LOGGER = LoggerFactory.getLogger(TestLogController.class);

    @Autowired
    private TestLogService testLogService;

    @GetMapping("/log")
    public String hello(){
        LOGGER.info("GLMAPPER-SERVICE:info");
        LOGGER.error("GLMAPPER-SERVICE:error");
        testLogService.printLogToSpecialPackage();
        return "hello spring boot";
    }






}
